/**
 * Created by Jackl on 2018/7/14.
 */

const path = require("path");
const ExtractTextPlugin = require('mini-css-extract-plugin');

module.exports = {
    mode: "production",
    entry: ["./src/index-webpack.ts", "./src/css/form.less"],
    output: {
        path: path.resolve(__dirname, "dist"),
        // filename: "form.js"
    },
    plugins: [
        new ExtractTextPlugin({ filename: "[name].css",})
    ],
    module: {
        rules: [
            {
                test: /\.ts$/,
                loader: "ts-loader"
            },
            {
                test: /\.tpl$/,
                loader:"raw-loader"
            },
            {
                test: /\.css$/,
                use: [ExtractTextPlugin.loader, 'css-loader']
            },
            {
                test:/\.less$/,
                use: [ExtractTextPlugin.loader, 'css-loader' ,'less-loader']
            },
        ]
    },
    resolve: {
        extensions: [".ts", ".d.ts", ".js"]
    }
};